package com.jxw.utils;

import android.content.Context;
import android.content.SharedPreferences;

/* loaded from: classes.dex */
public class SharedPreferencHelper {
    public static final String PREFS_NAME = "MyPrefsFile";
    private Context context;
    private SharedPreferences sharedPreferences;

    public SharedPreferencHelper(Context context) {
        this.context = context;
        this.sharedPreferences = context.getSharedPreferences(PREFS_NAME, 0);
    }

    public boolean putString(String str, String str2) {
        SharedPreferences.Editor edit = this.sharedPreferences.edit();
        edit.putString(str, str2);
        return edit.commit();
    }

    public String getString(String str, String str2) {
        return this.sharedPreferences.getString(str, "");
    }

    public boolean putBoolean(String str, boolean z) {
        SharedPreferences.Editor edit = this.sharedPreferences.edit();
        edit.putBoolean(str, z);
        return edit.commit();
    }

    public boolean getBoolean(String str) {
        return this.sharedPreferences.getBoolean(str, false);
    }
}
